package com.sectop.bank;

import java.util.ArrayList;
import java.util.List;

public class Customer {
    private String firstName;
    private String lastName;
    private List<Account> account;
    private Account acc;
    protected SavingAccount savingAccount;
    protected CheckingAcc checkingAccount;


    public Customer(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
        account = new ArrayList<>();
    }

    public Customer( ) {
        savingAccount = null;
        checkingAccount = null;
    }

    public SavingAccount getSavings () {
        return savingAccount;
    }

    public void setSavings (SavingAccount savingAccount) {
        this.savingAccount = savingAccount;
        account.add(savingAccount);
    }

    public CheckingAcc getChecking () {
        return checkingAccount;
    }

    public void setChecking (CheckingAcc checkingAccount) {
        this.checkingAccount = checkingAccount;
        account.add(checkingAccount);
    }
    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    public void addAccount(Account acc) {
         account.add(acc);
    }
    public int getNumOfAccounts(   ) {
        return  account.size();
    }

    public Account getAccount(int index) {
        return account.get(index);
    }


}
